 <template>
  <!-- 子组件1 -->
  <div>
    <button @click="btn">子组件A</button>
    <ul>
      <li v-for="(item, index) in arr" :key="index">
        <input type="checkbox" v-model="item.boo" @change="mo(item)" />
        {{ item.titele }}子组件A
      </li>
    </ul>
  </div>
</template>
 <script>
import Bus from "@/bus.js";
export default {
  props: ["arr"],
  data() {
    return {
      sw: false,
      op: false,
    };
  },
  //   组件A
  methods: {
    btn() {
      console.log([] ? true : false);
      console.log([] == false ? true : false);
      console.log({} == false ? true : false);
      this.sw = true;
      Bus.$emit("xs", this.sw);
    },
    mo(item) {
      console.log(this.arr);
      Bus.$emit("op", this.op);
      if (item.boo == false) {
        this.op = true;
      } else {
        this.op = false;
      }
    },
  },
  computed: {},
};
</script>
 <style lang='css' scoped>
* {
  margin: 0;
  padding: 0;
}
ul {
  position: fixed;
  left: 100px;
  top: 40px;
}
li {
  list-style: none;
}
</style>